package com.briup.oagg.facade.web.vm.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.Map;

@ApiModel(description = "算子信息显示参数")
@Data
public class LearnAlgorithmVM {
    @ApiModelProperty(value = "算子编号")
    private String algorithmId;

    @ApiModelProperty(value = "算子名称")
    private String algorithmName;

    @ApiModelProperty(value = "算子平台")
    private String platform;

    @ApiModelProperty(value = "算子类名",allowableValues = "MachineLearn,Sequential")
    private String className;

    @ApiModelProperty(value = "编码名称",notes = "深度学习必须有")
    private String codeName;

    @ApiModelProperty(value = "算法层配置信息")
    private List<LayerConfigVM> layers;

    @ApiModelProperty(value = "算法层配置信息(用于前端显示)")
    private List<LayerConfigVM> showLayers;

    @ApiModelProperty(value = "图示连线信息")
    private List<Map<String,Object>> links;

    @ApiModelProperty(value = "算子类型(0:分类 1:聚类  2:回归）")
    private Integer type;

//    public static class LayersDeserializer extends JsonDeserializer {
//
//        @Override
//        public Object deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
//            //1.获取组件 json字符串
//            String layers = jsonParser.getText();
//            System.out.println(layers);
//            //转化为list集合对象
//            ObjectMapper objectMapper = new ObjectMapper();
//            List<LayerConfig> layerConfigs = objectMapper.readValue(layers, new TypeReference<List<LayerConfig>>() {});
//            return layerConfigs;
//        }
//    }


}
